package com.ccx.mytemplate.util;

import lombok.Data;

@Data
public class Res {
    private int code;
    private Object data;
    private String msg;

    public static Res success(Object data) {
        Res res = new Res();
        res.code = 1;
        res.data = data;
        res.msg = "success";
        return res;
    }

    public static Res fail(String msg) {
        Res res = new Res();
        res.code = 0;
        res.data = null;
        res.msg = msg;
        return res;
    }
}
